package com.study.design.pattern.pattern.behavioral.visitor;

/**
 * @Author: gongsl
 * @Date: 2025-03-26 22:37
 */
public class Test {
    public static void main(String[] args) {
        // 创建公司对象结构
        Company company = new Company();
        company.addEmployee(new Manager("张三", 90));
        company.addEmployee(new Engineer("李四", 5000));
        // 访问者(绩效评估)
        EmployeeVisitor visitor = new PerformanceReportVisitor();
        // 统一访问所有员工
        company.accept(visitor);
    }
}
